package br.com.eduquiz.session;

import br.com.eduquiz.entity.*;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("reportBugHome")
public class ReportBugHome extends EntityHome<ReportBug> {
	
	private static final long serialVersionUID = -4613062326048343262L;
	
	@In(create = true)
	private PessoaHome pessoaHome;

	public void setReportBugId(Long id) {
		setId(id);
	}

	public Long getReportBugId() {
		return (Long) getId();
	}

	@Override
	protected ReportBug createInstance() {
		ReportBug reportBug = new ReportBug();
		return reportBug;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
		Pessoa pessoa = pessoaHome.getDefinedInstance();
		if (pessoa != null) {
			getInstance().setPessoa(pessoa);
		}
	}

	public boolean isWired() {
		return true;
	}

	public ReportBug getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
